//
//  View+BridgeScrollView.swift
//  BridgeScrollView
//
//  Created by zjkj on 2024/8/5.
//

import SwiftUI

extension View {
    public func scrollViewOffsetObserver(_ configuration: BridgeScrollConfiguration) -> some View {
        ScrollViewReader { scrollProxy in
            BridgeScrollView(configuration: configuration, content: self)
                .onAppear {
                    configuration.scrollViewProxy = scrollProxy
                }
        }
    }
}
